from pathlib import Path

d1 = r'M:\图\网图'

count = 0
for i in Path(d1).glob('*.jpeg'):
    count += 1
    print(i.name)
    try:
        i.rename(i.with_suffix('.jpg'))
        print(i.name, '-> jpg')
    except Exception as e:
        print(e)
